libxl: only issue cpu-add call to QEMU for not present CPU
authorWei Liu <wei.liu2@citrix.com>
Wed, 8 Jun 2016 14:01:02 +0000 (15:01 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 12 Jul 2016 11:49:41 +0000 (12:49 +0100)
commit56bac262e097684b20f7753ceb6debe594e9725c
treeee7b954e57234607b285650e8b5d4e15fc98504a
parent01f3193e2e3b9b36bde027f909db496f7211c320
libxl: only issue cpu-add call to QEMU for not present CPU

Calculate the final bitmap for CPUs to add to avoid having annoying
error messages complaining those CPUs are already present. Example
message is like (wrapped):

libxl: error: libxl_qmp.c:287:qmp_handle_error_response: received an
error message from QMP server: Unable to add CPU: 0, it already exists

We can also properly handle error from QMP now.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c